Skip to content

Rewrite ChatFish as a React + TypeScript SPA (remove .NET) - #14

Merged
dkackman merged 32 commits into
masterfrom
react-rewrite
Jul 6, 2026
Merged

dkackman merged 32 commits into
masterfrom
react-rewrite

Conversation

@dkackman

@dkackman dkackman commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Summary

Rebuilds ChatFish as a 100% client-side React 19 + TypeScript + Vite SPA at feature parity with the Blazor WebAssembly app, and removes the .NET projects. The LLM still runs entirely in the browser via web-llm in a Web Worker — no server-side inference, no chat data leaves the machine.

  • Fish physics ported nearly line-for-line to pure TS (src/engine/), driven by a fixed-step (50 ms) requestAnimationFrame loop that writes positions directly to DOM refs; React re-renders only for bubbles/direction changes
  • LLM layer (src/llm/): web-llm from npm in a Web Worker, streaming with first-token/inter-token stall watchdogs, reasoning-model <think> parsing with live thinking peek, answer-only transcript persistence
  • State: two zustand stores replace the C# event wiring; slash commands (/help, /about, /llm) and emotes (/shout, /whisper) preserved
  • PWA via vite-plugin-pwa (app shell + sprites precached; model weights stay in web-llm's own Cache Storage)
  • Tests: xUnit suite ported to Vitest — 71 tests across 10 files, all passing
  • Deploy: dig.toml now builds with npm ci && npm run build → dist/ (verified working with digstore 0.7.2 dev)
  • Blazor projects, solution, and dotnet tooling removed; README rewritten

Design spec: docs/superpowers/specs/2026-07-06-chatfish-react-rewrite-design.md
Implementation plan: docs/superpowers/plans/2026-07-06-chatfish-react-rewrite.md

Test plan

  • npm test — 71/71 passing
  • npm run build — clean; dist/ contains index.html, sw.js, manifest.webmanifest, sprites
  • Browser-verified: fish swim/bounce/drag, settings dialog + model list, /llm /help /shout /whisper /about, no-model error bubble, offline toast, manifest/sw served from preview
  • Manual (needs WebGPU + model download): model download progress + persistence, streamed chat with thinking dots, reasoning-model live peek (DeepSeek-R1 distill), watchdog stall message, PWA install

🤖 Generated with Claude Code

dkackman and others added 30 commits July 6, 2026 13:55
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…r the React app

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Prevent multiple sends while a reply is streaming in ChatInput and dispatcher.
- Update FishStore to track generating state for better UI feedback.
- Adjust button and input behavior based on generating state.
… fish spawning position logic to avoid tank edges
- upgraded @vitejs/plugin-react from ^4.5.0 to ^6.0.3
- upgraded jsdom from ^26.1.0 to ^29.1.1
- upgraded typescript from ~5.8.3 to ~6.0.3
- upgraded vite from ^7.0.0 to ^8.1.3
- upgraded vitest from ^3.2.0 to ^4.1.10
…SLint and Prettier configurations

feat: enhance engine tests with ChatCompletionRequest type and fix mock calls

chore: add .prettierignore and .prettierrc for consistent code formatting

chore: create eslint.config.js for ESLint setup with TypeScript and React Hooks
…nores, and add CLAUDE.md for project guidance
dkackman and others added 2 commits July 6, 2026 18:11
Duplicated @emnapi/core@1.11.1 nested under @rolldown/binding-wasm32-wasi
was out of sync with npm's dedup resolution, causing `npm ci` to fail in
CI with "Missing: @emnapi/core@1.11.2 from lock file".

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@dkackman
dkackman merged commit eaa4367 into master Jul 6, 2026
5 of 6 checks passed
@dkackman
dkackman deleted the react-rewrite branch July 6, 2026 23:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant